package com.springmvc.study.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
//@RequestMapping("/hello")//不会被视图解析器解析 返回json字符串
public class HelloController {


    @RequestMapping("/hello")   // url映射
    public String hello(Model model) {
        // 封装数据
        model.addAttribute("msg", "hello, SpringMVCAnnotation");
        return "hello";     // 会被视图解析器处理
    }

}
